My pemission is granted for anyone giving credit to Mark Welch and/or Geordie to use this however they please. If posting the tutorial, keep it whole. The code is open to play with and learn from.

This tutorial covers how to use up to three different ammo types in one gun. The only assumption is that you have installed the SDK and extracted the .uc files.

1) Begin by creating a new directory, I called mine DualAmmo, in the DeusEx folder, followed by a Classes subfolder. Assuming you are installed on C:/ your path will be

C:/DeusEx/DualAmmo/Classes/

2) Copy the file WeaponPistol from /DeusEx/DeusEx/Classes/ to /DeusEx/DualAmmo/Classes/ . To avoid confusion, rename it WeaponPistol_DA. Open WeaponPistol_DA and change the line

class WeaponPistol extends DeusExWeapon;

to

class WeaponPistol_DA extends DeusExWeapon;

3)We now have a new weapon class that behaves just like the old pistol. Let's change things :) You will have a line saying defaultproperties, followed by a { on the next line, then a whole bunch of lines such as HitDamage=14 and AmmoName=class'DeusEx.Ammo10mm' Each of these defines something about how the weapon behaves. The AmmoName describes the default ammunition used, and we need to add new lines beneath this to add more ammo types. The first should be

AmmoNames(0)=class'DeusEx.Ammo10mm'

This is very similar to the existing line, isn't it? All it does is allow you to use standard rounds once we add the new types. AmmoNames(0)= must match AmmoName= or strange things happen. After this tutorial, try it and see :)

4) Now I want to add the Plasma bolt from the Plasma Rifle, for sheer gratuitous overkill. Also, this is a projectile ammunition type, which actually has a visible 'bullet' when you fire. You need to add two lines for this,

AmmoNames(1)=Class'DeusEx.AmmoPlasma'

ProjectileNames(1)=Class'DeusEx.PlasmaBolt'

The first is the new ammunition type. The second says "AmmoNames(1) has an associated projectile, and the projectile is a class'DeusEx.PlasmaBolt' "

You could add a third type, AmmoNames(2)= if you wish. Note however, that if you were to add shotgun shells or sniper bullets, they will behave just like pistol bullets due to the way DeusEx works. Shotgun shells won't have spread, and sniper bullets won't go further or cause more damage. Rockets will though :) Yes, we can make a pistol load shotgun shells and normal rounds, but for there to be any difference between them will require more than one tutorials worth of code.

Congratulations! Your pistol is now stupidly loaded :) If you know how to compile and summon, tutorial over. Beware using this pistol alongside the regular one. There are some known bugs that will crop up if you do this. A fix is being discussed on the Ion storm forums, til then just be warned :) If you haven't compiled a new minimod before, here's a quick summary.

Make sure your file is saved.

Open DeusEx.ini from the /DeusEx/system/ folder. Find the section that has a whole load of

EditPackages=

lines. Add

EditPackages=DualAmmo

Underneath the last one.

Open a ms-dos prompt, go to the /DeusEx/System directory and type the command ucc make. This will read the .uc file you made and turn it into a .u file that the game can run.

Use the cheats (available from all good deus ex info sites - Deus Ex Incarnate lists many) to summon DualAmmo.WeaponPistol_DA. You may also want to summon Ammo10mm and AmmoPlasma to save hunting round the level :) 

Any Questions, queries or constructive critism to Geordie (Mark Welch) at mark_r_w@lineone.net